/*
 * Copyright (c) 2025 CAX Conversion Project
 */
package com.comac.ins.cax.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.comac.ins.cax.domain.vo.CaxQualityCheckerVo;
import com.comac.ins.cax.service.ICaxQualityCheckerService;
import com.comac.ins.common.core.domain.R;
import com.comac.ins.common.web.core.BaseController;
import jakarta.validation.constraints.NotEmpty;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 转换质量检查
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/cax/qualityChecker")
public class CaxQualityCheckerController extends BaseController {
    @Autowired
    private ICaxQualityCheckerService iCaxQualityCheckerService;

    /**
     * 根据转换记录id查询质量检查报告
     *
     * @param convertId 转换记录id
     * @return
     */
    @GetMapping("/queryByConvertId/{id}")
    @SaCheckPermission("cax:convert:queryByConvertId")
    public R<CaxQualityCheckerVo> queryByConvertId(@NotEmpty(message = "转换记录ID不能为空") @PathVariable("id") String convertId) {
        return R.ok(iCaxQualityCheckerService.queryByConvertId(Long.valueOf(convertId)));
    }

}
